{
  "properties" : { },
  "id" : "3d1ab6b1f8a545e5aaea42664b3cc048",
  "script" : null,
  "groupId" : "08c2af4fd56543e690b14515d83d66ae",
  "name" : "单表操作_查询",
  "createTime" : 1645934424150,
  "updateTime" : null,
  "lock" : null,
  "createBy" : "666",
  "updateBy" : null,
  "path" : "/table/select",
  "method" : "GET",
  "parameters" : [ {
    "name" : "name",
    "value" : "%测试%",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 1,\n    \"message\": \"success\",\n    \"data\": {\n        \"total\": 5,\n        \"list\": [\n            {\n                \"id\": \"7557a409802b4742b590122ef030b643\",\n                \"api_method\": \"GET\",\n                \"api_path\": \"/expression\",\n                \"api_script\": \"var ids = ['1','2','3'];\\r\\n\\r\\n//具体执行的SQL请看打印的运行日志信息。\\r\\n\\r\\ndb.select('select * from magic_api_info where id in (#{ids})')  //对参数自动展开\\r\\n\\r\\n//var id = '123';\\r\\ndb.select(\\\"select * from magic_api_info where id = #{id} \\\")  //拼接字符串的方式\\r\\n\\r\\n\\r\\n//var name = '123';\\r\\ndb.select(\\\"select * from magic_api_info where id = '123' ?{name,and api_name = #{name}}\\\")  //if 判断\\r\\n\\r\\nreturn 'ok';\",\n                \"api_parameter\": \"[{\\\"name\\\":\\\"message\\\",\\\"value\\\":\\\"Hello MagicAPI!\\\"}]\",\n                \"api_option\": \"[{\\\"value\\\":\\\"123\\\",\\\"description\\\":\\\"\\\",\\\"name\\\":\\\"231\\\"},{\\\"value\\\":\\\"22222222222222\\\",\\\"description\\\":\\\"包装请求参数到一个变量中\\\",\\\"name\\\":\\\"wrap_request_parameter\\\"},{\\\"name\\\":\\\"123\\\",\\\"value\\\":\\\"222\\\",\\\"description\\\":\\\"\\\"}]\",\n                \"api_name\": \"参数测试\",\n                \"api_group_id\": \"29e71549c6029ea63220f3c261cd422e\",\n                \"api_request_body\": \"{\\\"id\\\":\\\"123456\\\"}\",\n                \"api_request_header\": \"[{\\\"name\\\":\\\"token\\\",\\\"value\\\":\\\"tokenValue\\\"}]\",\n                \"api_response_body\": \"{\\n    \\\"code\\\": 1,\\n    \\\"message\\\": \\\"success\\\",\\n    \\\"data\\\": \\\"ok\\\",\\n    \\\"timestamp\\\": 1613011962313\\n}\",\n                \"api_description\": \"\",\n                \"api_create_time\": 1595066679177,\n                \"api_update_time\": 1613012042426\n            },\n            {\n                \"id\": \"986acacbb7a84ea58c2ceff7e74e04b5\",\n                \"api_method\": \"GET\",\n                \"api_path\": \"/log\",\n                \"api_script\": \"import log;\\r\\n// 切换到\\\"运行日志\\\"查看日志信息\\r\\nlog.info('info日志:{}',message);\\r\\nlog.warn('warn日志');\\r\\ntry{\\r\\n    return 1 / 0;\\r\\n}catch(e){\\r\\n    log.error('error日志',e);\\r\\n}\\r\\nreturn 'ok';\",\n                \"api_parameter\": \"[{\\\"name\\\":\\\"message\\\",\\\"value\\\":\\\"Hello MagicAPI!\\\"}]\",\n                \"api_option\": \"[]\",\n                \"api_name\": \"测试日志\",\n                \"api_group_id\": \"69f7cb163aee113acaa17f29c3053034\",\n                \"api_request_body\": \"{\\\"id\\\":\\\"123456\\\"}\",\n                \"api_request_header\": \"[{\\\"name\\\":\\\"token\\\",\\\"value\\\":\\\"tokenValue\\\"}]\",\n                \"api_response_body\": \"{\\n    \\\"code\\\": 1,\\n    \\\"message\\\": \\\"success\\\",\\n    \\\"data\\\": \\\"ok\\\",\\n    \\\"timestamp\\\": 1595065936684\\n}\",\n                \"api_description\": \"\",\n                \"api_create_time\": 1595065953402,\n                \"api_update_time\": 1611999375451\n            },\n            {\n                \"id\": \"998b865018a146aab9abd8f4ffdc8359\",\n                \"api_method\": \"GET\",\n                \"api_path\": \"/cache\",\n                \"api_script\": \"return db.cache('test').select('select api_name,api_method,api_path from magic_api_info');\",\n                \"api_parameter\": \"[{\\\"name\\\":\\\"message\\\",\\\"value\\\":\\\"Hello MagicAPI!\\\"}]\",\n                \"api_option\": \"[]\",\n                \"api_name\": \"缓存测试\",\n                \"api_group_id\": \"29e71549c6029ea63220f3c261cd422e\",\n                \"api_request_body\": \"{\\\"id\\\":\\\"123456\\\"}\",\n                \"api_request_header\": \"[{\\\"name\\\":\\\"token\\\",\\\"value\\\":\\\"tokenValue\\\"}]\",\n                \"api_response_body\": \"\",\n                \"api_description\": \"\",\n                \"api_create_time\": 1595064750136,\n                \"api_update_time\": 1608034438063\n            },\n            {\n                \"id\": \"a4ebe5b3b0a143e797e0027e37b089d3\",\n                \"api_method\": \"GET\",\n                \"api_path\": \"/page1\",\n                \"api_script\": \"// 默认从请求参数中读取page和size参数\\r\\nreturn db.page('select api_name from magic_api_info');\",\n                \"api_parameter\": \"[]\",\n                \"api_option\": \"[]\",\n                \"api_name\": \"分页测试\",\n                \"api_group_id\": \"29e71549c6029ea63220f3c261cd422e\",\n                \"api_request_body\": \"\",\n                \"api_request_header\": \"[]\",\n                \"api_response_body\": \"{\\n    \\\"code\\\": 1,\\n    \\\"message\\\": \\\"success\\\",\\n    \\\"data\\\": {\\n        \\\"total\\\": 30,\\n        \\\"list\\\": [\\n            {\\n                \\\"api_name\\\": \\\"文件下载\\\"\\n            },\\n            {\\n                \\\"api_name\\\": \\\"自定义json\\\"\\n            },\\n            {\\n                \\\"api_name\\\": \\\"if\\\"\\n            },\\n            {\\n                \\\"api_name\\\": \\\"try-catch\\\"\\n            },\\n            {\\n                \\\"api_name\\\": \\\"自定义分页\\\"\\n            },\\n            {\\n                \\\"api_name\\\": \\\"while\\\"\\n            },\\n            {\\n                \\\"api_name\\\": \\\"生成验证码\\\"\\n            },\\n            {\\n                \\\"api_name\\\": \\\"参数验证\\\"\\n            },\\n            {\\n                \\\"api_name\\\": \\\"字段转换\\\"\\n            },\\n            {\\n                \\\"api_name\\\": \\\"循环Map\\\"\\n            }\\n        ]\\n    },\\n    \\\"timestamp\\\": 1608437011041\\n}\",\n                \"api_description\": \"\",\n                \"api_create_time\": 1595064929177,\n                \"api_update_time\": 1608437025996\n            },\n            {\n                \"id\": \"ff2135698c6e4d1bad0db59195dfe706\",\n                \"api_method\": \"POST\",\n                \"api_path\": \"/select\",\n                \"api_script\": \"var sql = \\\"\\\"\\\"\\r\\n    select \\r\\n        '${message}' as user_name,\\r\\n        #{id} as user_id\\r\\n\\\"\\\"\\\";\\r\\nvar list = db.select(sql);\\r\\nreturn list;\",\n                \"api_parameter\": \"[{\\\"name\\\":\\\"message\\\",\\\"value\\\":\\\"Hello MagicAPI!\\\"}]\",\n                \"api_option\": \"[]\",\n                \"api_name\": \"测试执行SQL\",\n                \"api_group_id\": \"29e71549c6029ea63220f3c261cd422e\",\n                \"api_request_body\": \"\",\n                \"api_request_header\": \"[{\\\"name\\\":\\\"token\\\",\\\"value\\\":\\\"tokenValue\\\"}]\",\n                \"api_response_body\": \"{\\n    \\\"code\\\": 1,\\n    \\\"message\\\": \\\"success\\\",\\n    \\\"data\\\": [\\n        {\\n            \\\"user_name\\\": \\\"Hello MagicAPI!\\\",\\n            \\\"user_id\\\": null\\n        }\\n    ],\\n    \\\"timestamp\\\": 1608445664200\\n}\",\n                \"api_description\": \"\",\n                \"api_create_time\": 1593005960511,\n                \"api_update_time\": 1608445680348\n            }\n        ]\n    },\n    \"timestamp\": 1615817455553,\n    \"executeTime\": 13\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
return db.table('magic_api_info')
        .column('api_name') // 只查询api_name列
        .where()
        .like('api_name',name)
        .page()